package com.devin.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;

public class LogLogin {
    private int id;
    private String username;
    private Date visitTime;
    private String visitTimeStr;
    private String ip;
    private Long duration;
    private String url;
    private String method;

    public LogLogin() {
    }

    public LogLogin(int id, String username, Date visitTime, String visitTimeStr, String ip, Long duration, String url, String method) {
        this.id = id;
        this.username = username;
        this.visitTime = visitTime;
        this.visitTimeStr = visitTimeStr;
        this.ip = ip;
        this.duration = duration;
        this.url = url;
        this.method = method;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getVisitTime() {
        return visitTime;
    }

    public void setVisitTime(Date visitTime) {
        this.visitTime = visitTime;
    }

    public String getVisitTimeStr() {
        if(visitTime!=null){
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
            String format = dateFormat.format(visitTime);
            visitTimeStr=format;
        }
        return visitTimeStr;
    }

    public void setVisitTimeStr(String visitTimeStr) {
        this.visitTimeStr = visitTimeStr;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }
}
